import Vue from 'vue'
import Vuex from 'vuex'
// var openf1 = fso.OpenTextFile("json/ShoppingCart.json");
Vue.use(Vuex);
// fs.readFile('./mock/person.json',function(err,data){
//     if(err){
//         return console.error(err);
//     }else{

//     }
// })
const store = new Vuex.Store({
    state:{
        cartlist:[{
            "id":"01",
            "name":"巫师3 - 狂猎",
            "Price":"198",
            "imgurl":"src/lib/images/product/巫师3.jpg",
            "num":"1"
        }]
    },
    mutations:{
        call(state,cilback){
           var newVal = cilback(state.cartlist);
            state.cartlist = newVal;
            console.log(state.cartlist);
        }
    },
    getters:{
        getcartlist:()=>{

        }
    }
})
export default store;